import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: '/index',
    children: [
      {
        path: '/index',
        name: 'Index',
        component: () => import('../views/navBar/index.vue'),
        meta: {
          title: '首页'
        },
      },
      {
        path: '/course',
        name: 'Course',
        component: () => import('../views/navBar/course.vue'),
        meta: {
          title: '特色课'
        }
      },
      {
        path: '/record',
        name: 'Record',
        component: () => import('../views/navBar/record.vue'),
        meta: {
          title: '约课记录'
        }
      },
      {
        path: '/exercise',
        name: 'Exercise',
        component: () => import('../views/navBar/exercise.vue'),
        meta: {
          title: '练习'
        }
      },
      {
        path: '/my',
        name: 'My',
        component: () => import('../views/navBar/my.vue'),
        meta: {
          title: '我的'
        }
      },
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
